Implied Volatility of Index Options

In the article below, we will calculate the Implied Volatility of Future (Monthly) Options on the Index .STOXX50E (EURO STOXX 50 EUR PRICE INDEX) ('EUREX') and .SPX (S&P 500 INDEX). You can apply the logic below for another index, but those were chosen to examplify the workflow. Usually, the calculation of the Black-Scholes-Merton model's Implied Volatility involves numerical techniqhes, since it is not a closed equasion (unless restricting assumptions are made). If we used these techniques in calculating each Implied Volatility value on our computer, it would take several seconds - if not minutes - for each data point computed. I have chosen to use the Instrument Pricing Analytics (IPA) service in the Refinitiv Data Platform API Family instead, as this service allows me to send model specifications (and variables) and receive several (up to 100) computed Implied Volatility values in one go - in a few seconds. Not only does this save a great deal of time, but also many lines of code!

EUREX Call Options

In this article, we will attempt to calculate the Implied Volatility (IV) for Future Options on 2 indecies (.STOXX50E & .SPX) trading 'ATM', meaning that the contract's strike price is at (or near - within x%) parity with (equal to) its current treading price (TRDPRC_1). We are also only looking for such Options expiroing within a set time window; allowing for the option 'forever', i.e.: that expire whenever after date of calculation. To do so, we 1st have to find the option in question. To find live Options, we best use the Search API. To find Expiered Options we will use functions created in Haykaz's amazing articles "Finding Expired Options and Backtesting a Short Iron Condor Strategy" & "Functions to find Option RICs traded on different exchanges"

Finding Live Options (using Search API)

Live Options, in this context, are Options that have not expiered at time of computation. To be explisit:

As afformentioned, to find live Options, we best use the Search API: Here we look for options on .STOXX50E that mature on the 3rd friday of Jully 2023, 2023-07-21:

Let's say the current underlying price is 3331.7EUR, now we can pick the option with strike price closest to that, i.e.: the most 'At The Money'; note that this means that the option can be in or out the money, as long as it is the closest to at the money:

In this instance, for this Call Option, 'STXE33500G3.EX', the strike price is 3350, higher than the spot price of our underlying which is 3331.7. The holder of this 'STXE33500G3.EX' option has the right (but not the obligation) to buy the underlying for 3350EUR, which, was the price of the underlying to stay the same till expiry (3331.7EUR on 2023-07-21), means a loss of (3350 - 3331.7 =) 18.3EUR. This option in this instance is 'Out-The-Money'.

N.B.: When using the Filter in Search and playing with dates, it is good to read the API Playground Documentation; it mentions that: "Dates are written in ISO datetime format. The time portion is optional, as is the timezone (assumed to be UTC unless otherwise specified). Valid examples include 2012-03-11T17\:13:55Z, 2012-03-11T17\:13:55, 2012-03-11T12\:00-03:30, 2012-03-11.":

Function for Expiration days

Most of the time, market agents will be interested in the next expiring Option, unless we are too close to it. We would not be interested, for example, in an option expiring in 1 hour, or even tomorrow, because that is so close (in time) that the information reflected in the Option's trades in the market does not represent future expectations of its underlying, but current expectations of it.

To implement such a logic, we need to know what are the expiry dates of the option that we are interested in. We are looking for a Python function narrowing our search to options expiring on the 3rd friday of any one month. For info on this function, please read articles "Finding Expired Options and Backtesting a Short Iron Condor Strategy" & "Functions to find Option RICs traded on different exchanges"

Function to find the next expiring Option outside the next x day window

Most of the time, market agents will be interested in the next expiring Option, unless we are too close to it. We would not be interested, for example, in an option expiring in 1 hour, or even tomorrow, because that is so close (in time) that the information reflected in the Option's trades in the market does not represent future expectations of its underlying, but current expectations of it.

E.g.: I would like to know what is the next Future (Monthly) Option (i) on the Index '.STOXX50E' (ii) closest to ATM (i.e.: with an underlying spot price closest to the option's strike price) (ii) Expiring in more than x days (i.e.: not too close to calculated time 't'), let's say 15 days:

Now we can look for the one option we're after:

And again, we can collect the closest to ATM:

Now we have our instrument:

Refinitiv-provided Daily Implied Volatility

Refinitiv provides pre-calculated Implied Volatility values, but they are daily, and we will look into calculating them in higher frequencies:

Option Price

As you can see, there isn't nessesarily a trade every 10 min.:

However, for the statistical inferences taht we will make further in the article, when we will calculate Implied Volatilities and therefore implement the Black Scholes model, we will need 'continuous timeseries' with which to deal. There are several ways to go from discrete time series (like ours, even if we go down to tick data), but for this article, we will 1st focuss on making 'buckets' of 10 min. If no trade is made in any 10 min. bucket, we will assume the price to have stayed the same as previously, thoughout the exchange's trading hours which are:

thankfully this is simple. Let's stick with the EUREX for now:

Note that the option might not have traded in the past 10 min. This can cause issues in the code below, we thus ought to add a row for the current time:

Note also that one may want to only look at 'At Option Trade' datapoints, i.e.: Implied Volatility when a trade is made for the Option, but not when none is made. For this, we will use the 'At Trade' (AT) dataframes:

Underlying Asset Price

Now let's get data for the underying, which we need to calculate IV:

If you are interested in the opening times of any one exchange, you can use the following:

Let's put it al in one data-frame, df. Some datasets will have data going from the time we sert for start all the way to end. Some won't because no trade happened in the past few minutes/hours. We ought to base ourselves on the dataset with values getting closer to end and ffill for the other column. As a result, the following if loop is needed:

Strike Price

Risk-Free Interest Rate

Euribor values are released daily at 11am CET, and it is published as such on Refinitiv:

Now for the At Trade dataframe:

Annualized Continuous Dividend Rate

We are going to assume no dividends.

Calculating IV

On the Developer Portal, one can see documentation about the Instrument Pricing Analytics service that allows access to calculating functions (that use to be called 'AdFin'). This service is accessible via several RESTful endpoints (in a familly of endpoints called 'Quantitative Analytics') which can be used via RD:

Data returned this far was time-stamped in the GMT Time Zone, we need to re-calibrate it to the timezone of our machine:

Now for the At Trade dataframe:

With out-of-trading hours

From now on we will not show AT dataframe equivalents because it is... equivalent!

3 Graphs

Simple Graph

Certain companies are slow to update libraries, dependencies or Python versions. They/You may thus not have access to plotly (the graph library we used above). Matplotlib is rather light and should work, even on machines with old setups:

EUREX, or SPX Call or Put Options

Let's put it all together into a single function. This ImpVolatilityCalcIPA function will allow anyone to: (I) find the option (i) with the index of your choice (SPX or EUREX) as underlying, (i) closest to strike price right now (i.e.: At The Money) and (iii) with the next, closest expiry date past x days after today, (II) calculate the Implied Volatility for that option either (i) only at times when the option itself is traded or (ii) at any time the option or the underlying is being raded.

Conclusion

As you can see, not only can we use IPA to gather large amounts of bespoke, calculated, values, but be can also portray this insight in a simple, quick and relevent way. The last cell in particular loops through our built fundction to give an updated graph every 5 seconds using 'legacy' technologies that would work in most environments (e.g.: Eikon Codebook).

References

What is the RIC syntax for options in Refinitiv Eikon?

Functions to find Option RICs traded on different exchanges

Eikon Calc Help Page

Q&A

RIC nomenclature for expired Options on Futures

Expiration Dates for Expired Options API